package models;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Id;

import org.hibernate.validator.constraints.NotBlank;

import play.data.validation.Constraints.Required;
import play.db.ebean.Model;

@Entity
public class Picture extends Model {

    private static final long serialVersionUID = 1L;

    @Id
    private Long id;

    @NotBlank(message = "Name cannot be blank")
    @Required(message = "A name is required")
    private String name;

    @Required(message = "A description is required")
    private String description;

    @NotBlank(message = "Url cannot be blank")
    @Required(message = "An url is required")
    private String url;

    @Required(message = "A creation date is required")
    private Date creationDate;

    @Required(message = "A validity is required")
    private Boolean isValid;

    public static Finder<Long, Picture> find = new Finder<Long, Picture>(Long.class, Picture.class);

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Boolean getIsValid() {
        return isValid;
    }

    public void setIsValid(Boolean isValid) {
        this.isValid = isValid;
    }

    public Date getCreationDate() {
        return creationDate;
    }

    public void setCreationDate(Date creationDate) {
        this.creationDate = creationDate;
    }
}
